package com.hsq.androidproject.ui.Users;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.lenovo.androidproject3.R;
import com.hsq.androidproject.entity.UserBean;
import com.hsq.androidproject.ui.LoginActivity;
import com.hsq.androidproject.utils.glide.GlideRoundTransform;


public class ShowUsers extends Activity implements View.OnClickListener {
private ImageView my_iamge;
    private TextView my_name;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_users);
        UserBean user = (UserBean) getIntent().getSerializableExtra("user");
        my_iamge= (ImageView) findViewById(R.id.my_iamge);
        my_name= (TextView) findViewById(R.id.my_name);
        try {
            Glide.with(ShowUsers.this)
                    .load(user.getImageUrl())
                    .transform(new GlideRoundTransform(ShowUsers.this, 3))//圆角
                    .into(my_iamge);
            my_name.setText(user.getName());
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.huitui:
                this.finish();
                break;
        }
    }

    public void loginCLick(View view) {
        Intent intent=new Intent(this, LoginActivity.class);
        startActivity(intent);
        this.finish();
    }
}
